package com.cbtx.tablet.adapter

import android.widget.ImageView
import androidx.annotation.Nullable
import com.bumptech.glide.Glide
import com.cbtx.tablet.R
import com.cbtx.tablet.bean.GoodsItemBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * author : joker.peng
 * e-mail : joker@fiture.com
 * date   : 2021/7/5 11:57 AM
 * desc   :
 */
class RenZhengAdapter : BaseQuickAdapter<GoodsItemBean, BaseViewHolder>, LoadMoreModule {

    constructor(): super(R.layout.item_renzheng)

    override fun convert(holder: BaseViewHolder, item: GoodsItemBean) {
        val mIvCover: ImageView = holder.getView(R.id.mIvQRCode)
        Glide.with(context)
            .load(item.imageSmall)
            .error(R.mipmap.ic_default_small)
            .placeholder(R.mipmap.ic_default_small)
            .into(mIvCover)

        holder.setText(R.id.mTvType, item.years)
        holder.setText(R.id.mTvTitle, item.goodsName)
    }
}